<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>简单数组循环v-for</title>
        <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
    </head>

    <body>
        <div id="app">
            <ul>
                <!-- TODO:实现对简单数组的循环 -->
                <li v-for="(ingredient,index) in ingredients">
                    <h1>{{ingredient}}</h1>
                    <p>{{index}}</p>
                </li>
                
                <template v-for="(ingredient,index) in ingredients">
                    <h1>{{ingredient}}</h1>
                    <p>{{index}}</p>
                </template>
            </ul>
        </div>
        <script type="text/javascript">
            new Vue({
                el: '#app',
                data: {
                    ingredients: ['meat', 'fruit', 'cookies'],
                },
            });
        </script>
    </body>
</html>
